package com.texplose.service.impl;

import com.texplose.entity.Star;
import com.texplose.entity.enums.AppHttpCodeEnum;
import com.texplose.entity.vo.ResponseResult;
import com.texplose.mapper.StarMapper;
import com.texplose.service.StarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : lyj
 * @Timer : 2022/5/30
 * @Description :
 */
@Service
public class StarServiceImpl implements StarService {
    @Autowired
    private StarMapper starMapper;

    @Override
    public void insert(Star star) {
        starMapper.insert(star);
    }

    @Override
    public ResponseResult delete(Star star) {
        Integer updates = starMapper.delete(star);
        System.out.println(updates);
        if (updates == 0){
            return ResponseResult.errorResult(AppHttpCodeEnum.DELETE_ERROR);
        }
        return ResponseResult.okResult();
    }
}
